package cn.sdhuijin.vms.util;

import java.util.ArrayList;
import java.util.List;

import cn.sdhuijin.vms.model.Organization;

public class OrgUtil {
	public static List<Long> getAllIds(Organization org) {
		List<Long> ids = new ArrayList<Long>();
		ids.add(org.getId());
		List<Organization> children = org.getChildren();
		if (children != null && !children.isEmpty()) {
			for (Organization o : children) {
				ids.addAll(getAllIds(o));
			}
		}
		return ids;
	}
}
